home *** CD-ROM | disk | FTP | other *** search
/ Kompuutteri K-CD 2002 #1 / K-CD_2002-01.iso / Delphi / INSTALL / program files / Borland / Delphi6 / Doc / comserv.int < prev    next >
Encoding:
Text File  |  2001-05-22  |  2.3 KB  |  67 lines

  1. { *********************************************************************** }
  2. {                                                                         }
  3. { Delphi Runtime Library                                                  }
  4. {                                                                         }
  5. { Copyright (c) 1997-2001 Borland Software Corporation                    }
  6. {                                                                         }
  7. { *********************************************************************** }
  8.  
  9. {*******************************************************}
  10. {       COM server support                              }
  11. {*******************************************************}
  12.  
  13. unit ComServ;
  14.  
  15. {$DENYPACKAGEUNIT}                                  
  16.  
  17. interface
  18.  
  19. uses Windows, Messages, ActiveX, SysUtils, ComObj;
  20.  
  21. type
  22.  
  23. { Application start mode }
  24.  
  25.   TStartMode = (smStandalone, smAutomation, smRegServer, smUnregServer);
  26.  
  27. { Class manager event types }
  28.  
  29.   TLastReleaseEvent = procedure(var Shutdown: Boolean) of object;
  30.  
  31. { TComServer }
  32.  
  33.   TComServer = class(TComServerObject)
  34.   protected
  35.     function CountObject(Created: Boolean): Integer; override;
  36.     function CountFactory(Created: Boolean): Integer; override;
  37.     function GetHelpFileName: string; override;
  38.     function GetServerFileName: string; override;
  39.     function GetServerKey: string; override;
  40.     function GetServerName: string; override;
  41.     function GetStartSuspended: Boolean; override;
  42.     function GetTypeLib: ITypeLib; override;
  43.     procedure SetHelpFileName(const Value: string); override;
  44.   public
  45.     constructor Create;
  46.     destructor Destroy; override;
  47.     procedure Initialize;
  48.     procedure LoadTypeLib;
  49.     procedure SetServerName(const Name: string);
  50.     procedure UpdateRegistry(Register: Boolean);
  51.     property IsInprocServer: Boolean;
  52.     property ObjectCount: Integer;
  53.     property StartMode: TStartMode;
  54.     property UIInteractive: Boolean;
  55.     property OnLastRelease: TLastReleaseEvent;
  56.   end;
  57.  
  58. var
  59.   ComServer: TComServer;
  60.  
  61. function DllGetClassObject(const CLSID, IID: TGUID; var Obj): HResult; stdcall;
  62. function DllCanUnloadNow: HResult; stdcall;
  63. function DllRegisterServer: HResult; stdcall;
  64. function DllUnregisterServer: HResult; stdcall;
  65.  
  66. implementation
  67.